package com.etcsoft.pagedesigner.util;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;

import com.etcsoft.pagedesigner.common.Log;

/**
 * @author korman21@gmail.com
 */
public class ResourceUtil {
    public static IResource copy(IResource source, IPath destination, boolean force, IProgressMonitor monitor) {
        try {
            source.copy(destination, force, monitor);
        } catch (CoreException e) {
            Log.error("", e);
            return null;
        }
        return CommonUtil.findMember(destination);
    }
}
